#ifndef _WDS_SFX_H_
#define _WDS_SFX_H_

#include "wds_sounds.h"

#include "ui/ui_manager.h"
#include "vfx/sfx.h"




class WDSSfx
{
public:

	enum SFX_TYPES
	{
		SFX_NONE,

		SFX_NUKE,
		SFX_ROKETTRAIL,
		SFX_BULLET_FLAME,

		SFX_EXPLOSION_ROKET,
				
		SFX_COUNT
		
	};

	WDSSfx(WDSSfx::SFX_TYPES Type);
	~WDSSfx();

	virtual void						Render(const math::Vec2& Offset,float Scale);										
	virtual void						RenderDebug(const math::Vec2& Offset,float Scale);
	virtual void						Tick(float dt);


	void								Clear();	
	void								Load(const std::string& Name);
	void								ParticleLoad(const std::string& Name, int SpawnCount);
	bool								IsAlive() const { return m_IsAlive; };
	WDSSfx*								ReSpawn(	const math::Vec2& Pos,													
													float ScaleSize,
													float Rotation,
													WDSSounds::SOUND_NAMES SFXName,
													bool	bIsRegen = false
													);
	WDSSfx::SFX_TYPES					GetType()const { return m_Type; };
	void								FollowMe(const math::Vec2& Pos);
	void								SetPoition(const math::Vec2& Pos);
	void								ToDie();
	void								SetDelay(float Delay) { m_Delay = Delay; };
	void								SetRotation(float R) { m_Rotation = R; };
	bool								GetIsPostRender() const { return m_IsPostRender; };
	void								SetIsPostRender(bool b) { m_IsPostRender = b; };
	void								SetSkipDrawing(bool b) { m_SkipDrawing = b; };
	void								SetSFX(WDSSounds::SOUND_NAMES SFXName) { m_SoundSFXName = SFXName; };
	void								SetScale(float NewScale); 
	float								GetScale() const { return m_Scale; };
	
protected:

	

	void								MapTypeToName();
	

	bool								m_IsAlive;
	math::Vec2							m_Pos;	
	ui::UISprite						m_Sprite;
	WDSSfx::SFX_TYPES					m_Type;

	bool								m_bShouldDisappearWithCounter;
	math::Counter						m_DisappearCounter;


	float								m_Rotation;
	float								m_Alpha;
	math::Vec2							m_RandomDir;
	math::Vec2							m_RandomMovePos;
	float								m_RotationSpeed;

	part2d::Part2D*						m_pParticle;	

		
	bool								m_bShouldRandomRotate;	
	float								m_Scale;

	float								m_Delay;
	WDSSounds::SOUND_NAMES				m_SoundSFXName;
	bool								m_IsPostRender;
	bool								m_SkipDrawing;
	bool								m_IsToSpawnOnce;
	int									m_TriggerCount;	
	bool								m_IsTickCreationFinish;
	math::Vec2							m_SpawnSize;
	

};

#endif	   // _WDS_SFX_H_